import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useRouteStore = defineStore(
  'route',
  () => {
    const selectedKey = ref<string | null>(null)
    const updateSelectedKey = (value: string) => {
      selectedKey.value = value
    }
    return {
      selectedKey,
      updateSelectedKey,
    }
  },
  {
    persist: true, // 开启持久化
  },
)
